<script src="<? echo base_url(); ?>js/func_ajax.js"></script>
<script src="<? echo base_url(); ?>js/jquery.mousewheel.min.js"></script>
<script src="<? echo base_url(); ?>js/jquery-ui-1.8.21.custom.min.js"></script>
<script src="<? echo base_url(); ?>js/jquery.mCustomScrollbar.js"></script>
<link href="<?= base_url(); ?>css/jquery.mCustomScrollbar.css" rel="stylesheet" type="text/css" />
<!--<script>
    (function($){
        $(window).load(function(){
            $("#content_1").mCustomScrollbar({
                scrollButtons:{
                    enable:true
                }
            });
        });
    })(jQuery);
</script>-->
<?
if ($p_detail > 0):
    foreach ($p_detail as $row):
        ?>
        <div class="bdcrumb"><? echo $this->breadcrumb->output(); ?></div>
        <div class="ds-sanpham">
            <div id="InPdDetails">
                <div class="pdDetails-left">
                    <div class="pd-infor">
                        <div class="pd-infor-img"><img src="<?= base_url(); ?>images/sanpham/<?= $row->FPicture; ?>" alt="<?= $row->FName; ?>"/></div>
                    </div>
                </div>
                <div id="product_content_details">
                    <div><span class="headerFont1"><span id="pd_title">Tên sản phẩm:</span> <?= $row->FName; ?></span></div>
                    <div class="price">Giá: <?= format_price($row->FPrice, 'đ'); ?></div>
                    <div class="pd-infor-text">
                        <span class="largeSire">Miêu tả sản phẩm: </span>
                        <div class="pddt-text"><?= $row->FContent; ?></div>
                    </div>
                    <div class="bk">
                        <a href="https://www.baokim.vn/payment/deal_payment/product?receiver=manhcuong.go@gmail.com">
<img src="https://www.baokim.vn/application/uploads/buttons/btn_buy_now_1.png" alt="Thanh toán an toàn với Bảo Kim !" border="0" title="Thanh toán trực tuyến an toàn dùng tài khoản Ngân hàng (VietcomBank, TechcomBank, Đông Á, VietinBank, Quân Đội, VIB, SHB,... và thẻ Quốc tế (Visa, Master Card...) qua Cổng thanh toán trực tuyến BảoKim.vn">
</a>
                    </div>
                    <div class="AddCart">
                        <? echo form_open('gio_hang/addCart') ?>
                        <? echo form_submit('add', ''); ?>
                        <? echo form_hidden('fid', $row->FID); ?>
                        <? echo form_hidden('fname', $row->FName); ?>
                        <? echo form_hidden('fprice', $row->FPrice); ?>
                        <? echo form_hidden('fimg', $row->FPicture); ?>
                        <? echo form_close(); ?>
                    </div>
                </div>
            <? endforeach; ?>
        <? endif; ?>
        <div id="comment">
            <h2>Cảm nhận của khách hàng</h2>
            <form name="fr_cm" id="fr_cm" method="post" action="<?= base_url(); ?>product/UserComment/<?= $fid; ?>">
                <div id="cm_cont"><textarea name="cm_text" id="com_text" cols="68" rows="4"></textarea></div>
                <span id="btn_cm"><input type="submit" name="btnCM" class="btnCM" id="btnCM" value="Cảm nhận"/><input type="reset" name="btnRS" id="btnRS" value="Xóa"/></span>
                <p class="errors"></p>
            </form>
            <div id="cm_display">
                <div id="content_1" class="content">
                    <p id="load"><img src="<?= base_url();?>images/ajax-loader.gif" width="20" height="20"/></p>
                    <? if ($com): ?>
                        <? foreach ($com as $rows): ?>
                            <p>   
                                <b><?= $rows->Name; ?> <span class='cm_time'> <?= date_format(date_create($rows->date), "d-m-Y H:i"); ?></span></b>
                                <span class="cm_text"><?= $rows->CmContent ?></span>
                            </p>
                        <? endforeach; ?>    
                    <? else: ?>
                        <p>
                            <b id="thongBao">Không có bình luận nào. Bạn sẽ là người đầu tiên bình luận cho sản phẩm này chứ!</b>
                        </p>
                    <? endif; ?>
                </div>
            </div>
        </div>

    </div>
    <div class="clear"></div>
    <? if ($sptt): ?>
        <h2 class="cat-name">Sản phẩm cùng loại</h2>
        <? foreach ($sptt as $row2): ?>
            <div class="box">
                <div class="ProductCells">
                    <a href="<? echo site_url('chi-tiet/' . $row2->FSlug . '-' . $row2->FID); ?>"><img src="<? echo base_url(); ?>images/sanpham/<?= $row2->FPicture ?>" width="170" height="199"/></a>
                    <div class="text"><a href="<? echo site_url('chi-tiet/' . $row2->FSlug . '-' . $row2->FID); ?>" class="link_text"><?= $row2->FName ?></a></div>
                    <div class="price"><?= format_price($row2->FPrice, 'đ') ?></div>
                </div>
            </div>
        <? endforeach; ?>
    <? endif; ?>
    <div class="clear"></div>
</div>